/*
 * @Author: your name
 * @Date: 2021-10-29 16:36:48
 * @LastEditTime: 2021-11-10 15:43:03
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \app\src\directive\focus.js
 */
export default {
    // 当被绑定的元素插入到 DOM 中时……
    /* 
       el: 绑定指令的节点
       binding:包含绑定的指令的信息
            {
                name:指令名 v-focus:[a]='1+1'  => focus
                value:指令绑定值 (计算之后的值) v-focus:[a]='1+1'  => 2
                expression: 字符串的值 v-focus:[a]='1+1'  => 1+1
                arg:传给指令的参数 v-focus:[a]='1+1'  => a
                modifiers:修饰符对象 v-focus:[a].foo.bar='1+1'  => {foo:true,bar:true}
            }
    */
    inserted: function (el) {
        if (el.tagName == 'INPUT')
            el.focus();
        else if (el.className == 'el-input')
            console.log(el.firstChild)
    }
}